extends "../cTDR_2/cTDR_2.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "护林军"
	lv = 3
	attCoe.atkRan = 3
	attCoe.atk = 23 / 8.5 * 2 / 3
	attCoe.maxHp = 725 / 112.5 / 3

	addSkillTxt("强毒：毒基础伤害增加10%物攻；涂毒时，33%概率使随机一个敌方附加1层<毒>")
	addSkillTxt("毒爆：敌方死亡时，身上若有<毒>则对其周围一格敌人附加1层<毒>并对其造成100%物理伤害")

	

func _onBattleStart():
	._onBattleStart()
	exdmg += att.atk * 0.1
	#print(exdmg)
	var chas = getAllChas(1)
	for i in chas:
		i.addBuff(BF1.new(1,self))

class BF1:
	extends Buff
	var canremove:bool = false
	var exdmg
	var dmg
	var cha
	func _init(lv,cha):
		attInit()
		id = "db"
		self.exdmg = cha.exdmg + cha.att.atk*0.33
		self.dmg = cha.att.atk
		self.cha = cha
	var ctrl = globalData.infoDs["g_AneHek"]
	func _connect():
		._connect()
		masCha.connect("onDeath",self,"run")
		masCha.connect("onNewChara",self,"run1")

	func run1(cha):
		if cha.hasBuff("db"):return
		cha.addBuff(self)

	func run(atkinfo):
		#if cha == null:return
		if masCha.hasBuff("b_d"):
			var chas = masCha.getAllChas(2)
			var  cell = masCha.cell
			for i in chas:
				if abs(i.cell.x - cell.x) <= 1 && abs(i.cell.x - cell.y) <= 1:
					i.addBuff(ctrl.b_d.new(1,exdmg))
					if cha:
						cha.hurtChara(i,dmg,Chara.HurtType.PHY,Chara.AtkType.SKILL)
					else:
						i.hurtChara(i,dmg,Chara.HurtType.PHY,Chara.AtkType.SKILL)